<template>
  <el-row>
    <el-tag class="mt-10">普通通道</el-tag>
    <ul class="fz12" style="line-height: 2;border-top:1px solid #ccc;">
      <li><span>联系地址：</span>{{ form.area }}</li>
      <li><span>详细地址：</span>{{ form.address }}</li>
      <li><span>结算周期：</span>{{ form.balance_type }}</li>
      <li><span>支付功能：</span><span v-for="item in form.need_channel" :key="item">
        {{ item === 50 ? '银联（微信）条码支付，' : item === 51 ? '银联（微信）扫码支付，' : item === 52 ? '银联（微信）公众号支付，' : item === 53 ? '银联（微信）小程序支付，' : item === 54 ? '银联（微信）固定二维码支付' :  item === 1 ? '支付宝扫码支付，' : item === 2 ? '支付宝条码支付，' : item === 3 ? '支付宝一码多付，' : item === 17 ? '支付宝固定二维码，' : '' }}
      </span></li>
      <li>
        <h4 style="margin: 0 0 0 -20px">微信通道</h4>
      </li>
      <li><span>签约费率：</span>{{ form.wx_rate }} %</li>
      <li><span>经营类别：</span>{{ form.wx_category }}</li>
      <li><h4 style="margin: 0 0 0 -20px">支付宝通道</h4></li>
      <li><span>签约费率：</span>{{ form.ali_rate }} %</li>
      <li><span>经营类别：</span>{{ form.ali_category.name }}</li>
    </ul>
  </el-row>
</template>

<script>
import { verfiryChannelFuQuery } from '@/api/shop'
export default {
  data() {
    return {
      form: {
        area: '',
        address: '',
        balance_type: '',
        wx_rate: '',
        wx_category: {},
        ali_rate: '',
        ali_category: '',
        need_channel: [],
        channel_status: null
      }
    }
  },
  methods: {
    handleDoumentInit() {
      verfiryChannelFuQuery(this.$route.query.id).then(res => {
        if (res.data.errorCode === 0) {
          this.$emit('updateShow', ['ordin', true])
          this.form.area = res.data.result.area.name.toString()
          this.form.address = res.data.result.address
          this.form.balance_type = res.data.result.balance_type
          this.form.wx_rate = res.data.result.wx_rate
          this.form.wx_category = res.data.result.wx_category.name
          this.form.ali_rate = res.data.result.ali_rate
          this.form.need_channel = res.data.result.need_channel
          this.form.ali_category = res.data.result.ali_category
        }
      })
    },
    handleClickZoomImg(url) {
      this.$alert(`<img width="100%" heigth="100%" src= ${url}></img>`, {
        dangerouslyUseHTMLString: true,
        center: true,
        showConfirmButton: false,
        closeOnClickModal: true,
        closeOnPressEscape: true
      }).then(() => {
        return false
      }).catch(() => {
        return false
      })
    }
  },
  created() {
    this.handleDoumentInit()
  }
}
</script>
